package day01;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class interruptTest {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            log.debug("sleep...");
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }, "t1");


        t1.start();
        log.debug("interrupt...");
        Thread.sleep(1000);
        t1.interrupt();
        log.debug("{}", t1.isInterrupted());
    }
}
